home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-wos-src / machines / amigawos / libsrc / stdio / ftell.c < prev    next >
C/C++ Source or Header  |  1999-01-01  |  238b  |  12 lines

  1. #include <stdio.h>
  2. #include <errno.h>
  3.  
  4. long ftell(FILE *f)
  5. {
  6.     long offset;
  7.     offset=_seek(f->filehandle,0,SEEK_CUR);
  8.     if(f->flags&_READ) offset-=f->count;
  9.     if(f->flags&_WRITE) offset+=f->bufsize-f->count;
  10.     return(offset);
  11. }
  12.